<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/10/11 16:13
 * Desc: 游记
 */
class Request_Api_V2_Notes extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function get_list()
    {
        $this->rules = [
            ['page', ['digit', $this->rule_min(1)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function member_notes()
    {
        $this->rules = [
            ['page', ['digit', $this->rule_min(1)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
        ];

        // 自定义规则
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }

    public function delete()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]],
        ];

        // 自定义规则
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }

    public function thumbs_up()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function thumbs_down()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function edit()
    {
        $this->rules = [
            ['id', ['digit', $this->rule_min(1)]],
            ['phone', ['not_empty', 'phone']],
            ['captcha_key', ['not_empty']],
            ['code', ['not_empty']],
            ['msg_code', ['not_empty']],
            ['title', ['not_empty']],
        ];

        // 自定义规则
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        return $this;
    }
}